package com.frame.controller;


import com.frame.config.Result;
import com.frame.domain.SysDictionary;
import com.frame.service.SysDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SysDictionaryController {

    @Autowired
    RedisTemplate redisTemplate;

    @Autowired
    SysDictionaryService sysDictionaryService;

    //查询字典表数据
    @RequestMapping("SysDictionaryList")
    public Result SysDictionaryList(){
        List<SysDictionary> list = sysDictionaryService.SysDictionaryList();
        redisTemplate.opsForList().leftPushAll(list);
        return Result.success(list);
    }
}
